package com.jiezhuo.controller.jss;

import com.jiezhuo.entity.cmeduSchool.JzgNewMenu;
import com.jiezhuo.service.jss.JssXtAppmenuService;
import com.jiezhuo.utils.R;
import com.jiezhuo.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * 服务控制器
 *
 * @author kancy
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2024-06-13 08:48:15
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@Api(tags = "寄宿生管理--菜单")
@Transactional
@RequestMapping("/jssXtAppmenu")
public class JssXtAppmenuController {
    private final JssXtAppmenuService jssXtAppmenuService;


    @ApiOperation("获取菜单")
    @GetMapping("getJssGMenuTree")
    public R getMenuTree() {
        String userId = SecurityUtils.getCurrentUserId();
        ArrayList<JzgNewMenu> MenuTree = jssXtAppmenuService.getMenuTree(userId);
        return R.ok().data("menuTree", MenuTree);
    }
}